package com.cdy.grpcclient.controller

import com.cdy.grpcclient.service.StudentService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

@RestController
class GrpcClientController{

    @Autowired
    private lateinit var studentService: StudentService

    @RequestMapping("/student")
    fun printMessage( @RequestParam("name")  name: String ) : String {
        return studentService.getStudent(name).name

    }

}